package wang.wangby.autoconfigure.lazydoc;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import wang.wangby.lazydoc.common.DocRules;
import wang.wangby.lazydoc.controller.LazyDocController;
import wang.wangby.lazydoc.service.LazyDocService;

@Configuration
@EnableConfigurationProperties({ LazyDocProperties.class })
public class LazyDocAutoConfiguration {

	@Bean
	public LazyDocController lazyDocController() {
		return new LazyDocController();
	}
	
	@Bean
	public LazyDocService lazyService() {
		return new LazyDocService();
	}
	
	@Bean
	@ConditionalOnMissingBean
	public DocRules docRules() {
		return new DocRules();
	}
}
